#pragma once

#include "Action.h"
#include "tinyxml/tinyxml.h"

#define CBuilderObj CBuilderInfo::GetInstance()

class CBuilderInfo
{
public:
	enum RunModle {
		InstallModle,
		UninstallModle,
	};

	static CBuilderInfo& GetInstance();

	int Init(RunModle modle);

	bool GetValue(const std::wstring& strKey, std::wstring& strValue);

	int Action();

private:
	CBuilderInfo();
	~CBuilderInfo();
	static CBuilderInfo gBuilder;

	void CheckEvent();
	CAction* CreateAction(MYUI::TiXmlElement* pNode);
	int Parse(MYUI::TiXmlDocument* pDocument);
public:
	CAction::Platform SystemPlatfrom;
	RunModle ProcessRunModle;
	LONG SystemNumber;
	std::wstring SystemVersion;
	std::wstring InstallPath;
	std::wstring RunAsComplete;
	std::vector<CAction*> m_vecAction;

	std::wstring ExecBtnName;
	std::wstring PathCtrlName;
	std::wstring ProgressCtrlName;
	std::wstring ClauseCtrlName1;
	std::wstring ClauseCtrlName2;

};
